import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import'./App.css'

import * as serviceWorker from './serviceWorker';

let element = (
  <div>
    <h1>helloword</h1>
    <h2>{1+1}</h2>
  </div>

)
let man ='发烧';
let element2 = (
  <div>
    <h1>今天是否隔离</h1>
    <h2>{man == "发烧"?<button>隔离</button>:"瘫床上" }</h2>  

  </div>
)

let element4 = (
    <div>
        <span>横着躺</span>
        <span>竖着躺</span>
    </div>
)

man = '正常'
const str = "今天的日期是"
const date = new Date().toLocaleTimeString()

let element3 = (
  <div>
    <h1>今天是否隔离</h1>
    <h1>{str+date}</h1>
    <span>{1+1+1}</span>
    <h2>{man == "发烧"?<button>隔离</button>:element4}</h2>  
    
  </div>

)

let color = 'bag'
let logo = 'https://www.baidu.com/img/dong_66cae51456b9983a890610875e89183c.gif'

//HTML样式类名要写className，因为class在js当中是关键字
let element5 = (
  <div className={color}>
    <img src={logo}></img>
    背景色
  </div>
)

console.log(element);

ReactDOM.render(
  element3,
  document.getElementById('root')

)



// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
